﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Model;
using DevExpress.XtraEditors;

namespace TransLogger.Module.Win.Editors
{
    public interface IModelButtonViewItemWin : IModelViewItem
    {
    }

    [ViewItem(typeof(IModelButtonViewItemWin))]
    public class ButtonViewItem : ViewItem
    {
        public ButtonViewItem(IModelViewItem model, Type objectId) : base(objectId, model.Id)
        {
        }

        protected override object CreateControlCore()
        {
            var button = new SimpleButton() {Text = "MyButton"};
            button.Click += ButtonOnClick;
            return button;
        }

        private void ButtonOnClick(object sender, EventArgs eventArgs)
        {
            MessageBox.Show("my button lcicked");
        }
    }
}
